package com.ctshk.rpc.user.service;

import com.ctshk.common.dto.Result;
import com.ctshk.common.model.PageResponse;
import com.ctshk.rpc.user.dto.UserMessageDTO;
import com.ctshk.rpc.user.dto.UserMessageListDTO;
import com.ctshk.rpc.user.req.UserMessagePageReq;
import com.ctshk.rpc.user.req.UserMessageReq;

import java.util.concurrent.CompletableFuture;

/**
 * <p>
 *  用户消息接口
 * </p>
 *
 * @author 李新科
 * @date 2021/5/17 11:56
 */
public interface IUserMessageService {
    Result<PageResponse<UserMessageListDTO>> queryPage(UserMessagePageReq req);


    /**
     * 单项发送通知接口
     * @param req
     * @return
     */
    CompletableFuture<Result> notify(UserMessageReq req);

    /**
     * 订单通知
     * @param userId 推送C端用户的id
     * @param title
     * @param content
     * @param orderId 订单Id
     * @param businessType 业务类型 取枚举类SystemBusinessType
     * @return
     */
    CompletableFuture<Result> orderNotify(Long userId,String title,String content,Long orderId,Integer businessType);

    /**
     * 系统通知
     * @param userId
     * @param title
     * @param content
     * @return
     */
    CompletableFuture<Result> sysNotify(Long userId,String title,String content);

    Result<UserMessageDTO> detail(Long id, Long id1);

    Integer countByUserId(Long userId);
}
